package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * \* User: chy
 * \* Date: 2025/9/26  16:05
 * \* Description:
 * \
 */
@RestController("workerBankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务端 - 银行账户相关接口")
@Slf4j
public class BankAccountController {

    @Resource
    private IBankAccountService bankAccountService;
    /**
     * 添加银行账户
     *
     * @param reqDTO
     */
    @PostMapping
    public void addBankAccount(@RequestBody BankAccountUpsertReqDTO reqDTO) {
        log.info("添加银行账户{}", reqDTO);
        bankAccountService.addBankAccount(reqDTO);

    }
    /**
     * 获取当前用户银行账户信息
     *
     * @return
     */
    @GetMapping("/currentUserBankAccount")
    public BankAccountUpsertReqDTO getCurrentUserBankAccount() {
        log.info("获取当前用户银行账户");
        return bankAccountService.getCurrentUserBankAccount();
    }
}
